﻿// Study1102.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
// 第十一章 流类库 操纵符

#include <iostream>
#include <iomanip>
#include <string>
using namespace std;

int main()
{
    double values[] = { 1.23,25.36,653.7,4358.24 };
    string names[] = { "Zoot","Jimmy","Al","Stan" };
    for (int i = 0; i < 4; ++i)
    {
        cout << setw(6) << names[i] << setw(10) << values[i] << endl;
    }
    cout << "======================================="<<endl;
    for (int i = 0; i < 4; ++i)
    {
        cout <<setiosflags(ios_base::left)<< setw(6) << names[i] << setw(10) << values[i] << endl;
    }
    cout << "=======================================" << endl;

    for (int i = 0; i < 4; ++i)
    {
        cout << setiosflags(ios_base::left) << setw(6) << names[i] << setw(10) <<setprecision(1) << setiosflags(ios_base::scientific) << values[i] << endl;
    }
    return 0;
}

